using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MWIS.Common;

public partial class _Default : System.Web.UI.Page
{
    MwisXml mwisXml = new MwisXml();
    MwisProducts mwisProduct = new MwisProducts();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ArrayList productCategory = mwisXml.GetCategory(true);

            foreach (string product in productCategory)
            {
                drpdCategories.Items.Add(product);
            }

            drpdCategories.Items.Add("Other");
        }
    }
    protected void btnIntroduce_Click(object sender, EventArgs e)
    {
        mwisProduct.ProductName=txtProduct.Text;
        mwisProduct.CategoryID = mwisXml.getCategoryID(drpdCategories.Text);
        mwisProduct.IntroducedBy = "Admin";//Add the Session Variable's Value
        mwisProduct.Comments = txtDescription.Text;

        mwisProduct.IntroduceProduct();
    }
}
